#include "shm.hpp"
#include "namedPipe.hpp"

int main()
{
    //创建共享内存
    Shm shm(pathname, proj_id, Creat); 
    char* shmaddr = (char*)shm.GetShmaddr();

    //创建管道
    NamedPipe pipe("./myfifo", Creater);
    if(pipe.ReadOpen())
    {
        std::string message;
        //服务端读
        while(true)
        {
            //先读取命名管道
            pipe.ReadFromPipe(message);
            //再读取共享内存
            std::cout<< "server> " << shmaddr <<std::endl;
        }   
    }

    return 0;
}